#!/bin/bash

#------------------------------------------------------------------------------
#Filename:      74778-bash.sh
#Version:       1.1
#Date:  	2013/06/17
#Author:        yuanhui.shi
#Email: 	yuanhui.shi@cs2c.com.cn
#Summary:       02.01系统核心功能-06基础命令行工具-01bash-02验证基本功能
#Notes: 	验证bash
#Copyright:     China Standard Software Co.,Ltd.
#History:
#       	Version 1.0,2013/06/17
#       	-The first one
#       	Version 1.1,2013/09/05
#       	-Modify the script to satisfy the shell standard
#------------------------------------------------------------------------------


PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH

source ../../lib/Echo.sh

function CleanData ()
{
 rm -rf ${TMPDIR}
 EchoInfo "74778-bash.sh执行完毕"
}

trap "CleanData" EXIT

TMPDIR=/tmp/bash$$
mkdir ${TMPDIR}
EchoResult "mkdir ${TMPDIR}"

cat  > ${TMPDIR}/hello.sh << EOF
# hello.sh
#! /bin/bash
echo "Hello World!"
EOF

OUTPUT=`sh ${TMPDIR}/hello.sh`
[ "${OUTPUT}" == "Hello World!" ]
EchoResult "执行成功" 


